xen,pod: Try to reclaim superpages when ballooning down
authorGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 28 Jun 2012 14:18:00 +0000 (15:18 +0100)
committerGeorge Dunlap <george.dunlap@eu.citrix.com>
Thu, 28 Jun 2012 14:18:00 +0000 (15:18 +0100)
commita8a3ef6318f5fedaf539c77d00db37ef5a7ea7fc
treea1ef243f126d154dc72c68a812e2a958c6c97781
parent2eab1066e4f4a81a7c26a1b25db08c9c1c36ee48
xen,pod: Try to reclaim superpages when ballooning down

Windows balloon drivers can typically only get 4k pages from the kernel,
and so hand them back at that level.  Try to regain superpages by checking
the superpage frame that the 4k page is in to see if we can reclaim the whole
thing for the PoD cache.

This also modifies p2m_pod_zero_check_superpage() to return SUPERPAGE_PAGES on
success.

v2:
 - Rewritten to simply to the check as in demand-fault case, without needing
   to know that the p2m entry is a superpage.
 - Also, took out the re-writing of the reclaim loop, leaving it optimized for
   4k pages (by far the most common case), and simplifying the patch.
v3:
 - Add SoB

Signed-off-by: George Dunlap <george.dunlap@eu.citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Committed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/p2m-pod.c